// Enum.ts
export class Enum {
    private map: Record<string, { label: string; value: any }> = {};
    private items: { key: string; label: string; value: any }[] = [];
  
    add(field: string, label: string, value: any) {
      this.map[field] = { label, value };
      this.items.push({ key: field, label, value });
      return this;
    }
  
    getLabelByValue(value: any) {
      const found = this.items.find(item => String(item.value) === String(value));
      return found ? found.label : value;
    }
  }